package com.example;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

public class MyClass {
    public static void main(String [] args){
        Schema schema = new Schema(1,"com.example.mycarofcountry.entity.dao");
        Entity fcusing = schema.addEntity("Recommend_Focusing");
        //数据库字段名
        fcusing.addStringProperty("title").primaryKey();
        fcusing.addStringProperty("imgurl");


        Entity newslist = schema.addEntity("Recommend_Newslist");
        newslist.addLongProperty("id").primaryKey();
        newslist.addStringProperty("title");
        newslist.addStringProperty("time");
        newslist.addStringProperty("smallpic");
        newslist.addLongProperty("replycount");


        Entity evaluating = schema.addEntity("Recommend_Evaluating");
        evaluating.addStringProperty("title").primaryKey();
        evaluating.addStringProperty("time");
        evaluating.addStringProperty("smallpic");
        evaluating.addLongProperty("replycount");


        Entity news = schema.addEntity("Recommend_News");
        news.addStringProperty("text").primaryKey();
        news.addStringProperty("name");
        news.addStringProperty("profile_image");
        news.addStringProperty("created_at");
        news.addStringProperty("voiceuri");
        news.addStringProperty("voicetime");
        news.addStringProperty("image0");



        Entity vehiclelist = schema.addEntity("Recommend_Vehiclelist");
        vehiclelist.addStringProperty("title").primaryKey();
        vehiclelist.addStringProperty("typename");
        vehiclelist.addStringProperty("advancetime");
        vehiclelist.addStringProperty("bgimage");
        vehiclelist.addLongProperty("reviewcount");



        Entity technologylist = schema.addEntity("Recommend_Technologylist");
        technologylist.addStringProperty("title").primaryKey();
        technologylist.addStringProperty("time");
        technologylist.addStringProperty("type");
        technologylist.addStringProperty("smallpic");
        technologylist.addStringProperty("indexdetail");
        technologylist.addIntProperty("mediatype");



        Entity totalist = schema.addEntity("Forum_total");
        totalist.addStringProperty("title").primaryKey();
        totalist.addStringProperty("lastreplydate");
        totalist.addStringProperty("bbsname");
        totalist.addStringProperty("postusername");
        totalist.addIntProperty("replycounts");



        Entity reduceDealer = schema.addEntity("ReduceDealer");
        reduceDealer.addStringProperty("city");
        reduceDealer.addStringProperty("shortname");
        reduceDealer.addStringProperty("distance");
        reduceDealer.addStringProperty("orderrange");
        reduceDealer.addLongProperty("dealer_id").primaryKey();



        Entity reduceCarList = schema.addEntity("ReduceCarList");
        reduceCarList.addLongProperty("_id").primaryKey().autoincrement();
        reduceCarList.addStringProperty("specpic");
        reduceCarList.addStringProperty("seriesname");
        reduceCarList.addStringProperty("specname");
        reduceCarList.addFloatProperty("dealerprice");
        reduceCarList.addFloatProperty("fctprice");
        reduceCarList.addLongProperty("dealer_id");


        Entity jingxuanList = schema.addEntity("JingXuanList");
        jingxuanList.addStringProperty("text").primaryKey();
        jingxuanList.addStringProperty("name");
        jingxuanList.addStringProperty("profile_image");
        jingxuanList.addStringProperty("created_at");
        jingxuanList.addStringProperty("love");
        jingxuanList.addStringProperty("hate");
        jingxuanList.addStringProperty("image0");
        jingxuanList.addStringProperty("is_gif");
        jingxuanList.addStringProperty("repost");
        jingxuanList.addStringProperty("comment");


        Entity famousList = schema.addEntity("FamousList");
        famousList.addStringProperty("text").primaryKey();
        famousList.addStringProperty("name");
        famousList.addStringProperty("profile_image");
        famousList.addStringProperty("created_at");
        famousList.addStringProperty("love");
        famousList.addStringProperty("hate");
        famousList.addStringProperty("repost");
        famousList.addStringProperty("comment");
        try {
            new DaoGenerator().generateAll(schema,"./app/src/main/java");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
